package dao;

import model.Subject;

import java.util.List;

/**
 * The interface Subject dao.
 */
public interface SubjectDao {
    /**
     * Get subject.
     *
     * @param sid the sid
     * @return the subject
     */
    Subject get(long sid);

    /**
     * Find by page list.
     *
     * @param pageIndex the page index
     * @param pageSize  the page size
     * @return the list
     */
    List<Subject> findByPage(int pageIndex, int pageSize);//分页查找

    /**
     * Find by name list.
     *
     * @param sname     the sname
     * @param pageIndex the page index
     * @param pageSize  the page size
     * @return the list
     */
    List<Subject> findByName(String sname, int pageIndex, int pageSize);
    List<Subject> findById(long sid, int pageIndex, int pageSize);

    /**
     * Count int.
     *
     * @return the int
     */
    int count();

    int countById(long sid);
    /**
     * Count by name int.
     *
     * @param sname the sname
     * @return the int
     */
    int countByName(String sname);

    /**
     * Insert int.
     *
     * @param subject the subject
     * @return the int
     */
    int insert(Subject subject);

    /**
     * Delete int.
     *
     * @param sid the sid
     * @return the int
     */
    int delete(long sid,long uid);

    /**
     * Update int.
     *
     * @param subject the subject
     * @return the int
     */
    int update(Subject subject);


}
